//
//  String+EastAsianWidth.swift
//  EastAsianWidth
//
//  Created by Yuki Takahashi on 2017/02/16.
//  Copyright © 2017年 waft. All rights reserved.
//

import Foundation

public extension String {
    var containsEastAsianAmbiguousCharacters: Bool {
        return unicodeScalars.contains { $0.isEastAsianAmbiguous }
    }
    
    var containsEastAsianHalfwidthCharacters: Bool {
        return unicodeScalars.contains { $0.isEastAsianHalfwidth }
    }
    
    var containsEastAsianFullwidthCharacters: Bool {
        return unicodeScalars.contains { $0.isEastAsianFullwidth }
    }
    
    var containsEastAsianNarrowCharacters: Bool {
        return unicodeScalars.contains { $0.isEastAsianNarrow }
    }
    
    var containsEastAsianNeutralCharacters: Bool {
        return unicodeScalars.contains { $0.isEastAsianNeutral }
    }
    
    var containsEastAsianWideCharacters: Bool {
        return unicodeScalars.contains { $0.isEastAsianWide }
    }
    
    var containsFullwidthOrAmbiguousCharacters: Bool {
        return unicodeScalars.contains { $0.isFullwidthOrAmbiguous }
    }
    
    var containsFullwidthCharacters: Bool {
        return unicodeScalars.contains { $0.isFullwidth }
    }
    
    var containsHalfwidthOrAmbiguousCharacters: Bool {
        return unicodeScalars.contains { $0.isHalfwidthOrAmbiguous }
    }
    
    var containsHalfwidthCharacters: Bool {
        return unicodeScalars.contains { $0.isHalfwidth }
    }
}
